function jsdump(str)
{
  Components.classes['@mozilla.org/consoleservice;1']
            .getService(Components.interfaces.nsIConsoleService)
            .logStringMessage(str);
}

function setView(index)
{
  var deck = document.getElementById("deck");
  deck.setAttribute("selectedIndex", index);
}

function setBrowserView()
{
  setView(0);
}

function setSearchView()
{
  setView(1);
}

function setOperationsView() {
  setView(2);
}

function setSchemaView()
{
  setView(3);
}

function setDirectoryConfigView()
{
  setView(4);
}

function connSetup()
{
}

function onload()
{
	jsdump("-> onload()");

	gLdapConn = Components.classes["@mozilla.org/network/ldap-connection;1"].createInstance().QueryInterface(Components.interfaces.nsILDAPConnection);
	if (gLdapConn)
	{
		jsdump("LDAP interfaces and components are available.");

		initialiserLDAP("cn=admin,dc=beretti,dc=org", "localhost");

		document.getElementById("LDAPDataTree").view = new LDAPDataTreeView;
	}
}

var gLdapConn;

//addEventListener("load", onload, false);
